package com.learn.transaction_control;

import com.learn.transaction_control.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;

@ComponentScan
@PropertySource("classpath:application.properties")
public class TransactionControl {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(TransactionControl.class);
        AccountService accountDao = applicationContext.getBean("accountService", AccountService.class);
        
        accountDao.transferMoney(2, 1, 1000);
    }
}
